library Antibiotics initializer init 

	
	private function Trig_Antibiotics_Conditions takes nothing returns boolean
		return GetSpellAbilityId()=='A02V'
	endfunction

	private function Trig_Antibiotics_Actions takes nothing returns nothing
		local unit u = GetSpellTargetUnit()
		local player p = GetOwningPlayer(u)
		local integer id = 7*GetPlayerId(p)
		local integer i = 2
		if GetPlayerController(p)==MAP_CONTROL_USER then
			loop
				exitwhen i > 7
				set udg_AilmentChance[id+i] = udg_AilmentChance[id+i]+1
				set i = i + 1
			endloop
		endif
		call UnitRemoveAbility(u,'Bpoi')
		call UnitRemoveAbility(u,'Bpsd')
		call UnitRemoveAbility(u,'B008')
		set u = null
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		set t = CreateTrigger(  )
		call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
		call TriggerAddCondition( t, Condition( function Trig_Antibiotics_Conditions ) )
		call TriggerAddAction( t, function Trig_Antibiotics_Actions)
	endfunction

endlibrary